<template>
  <div>
    <Header></Header>
    <router-view></router-view>
    <!-- 方式1 -->
    <!-- <Footer v-if="!$route.meta.isHidden"></Footer> -->
        <!-- 方式2 -->
      <Footer v-if='!isShow'></Footer>
  </div>
</template>

<script>
import Header from "@/components/Header";
import Footer from "@/components/Footer";

import { mapActions} from "vuex";
export default {
  name: "App",
  components: {
    Header,
    Footer,
  },
 
  mounted(){
    // console.log(this.$route.name,'22222222222222')
    //$route,  当我们在组件里面通过this拿到$route的时候是获取路由跳转的时候的参数的
    //$router  当我们在组件里面通过this拿到$router的时候是要使用编程式路由导航跳转路由的
    // console.log(this.$route.name,'````````````````````');
        // console.log(this.$router.options.routes,'11111111111111111111')
          this.getCategoryList();
  },

  computed:{
    isShow(){
    return  this.$route.name==='login'||this.$route.name==='register'},
 
  },
  methods:{
        ...mapActions("category", ["getCategoryList"]),
  }
};
</script>

<style>
</style>